#!/bin/bash
#对以下随机数组排序

ary=(134 223 45 98 76 243 8 6 1 47)
num=${#ary[*]}

for ((i = 0; i < num-1; i++));do
	for ((j = 0; j < num-i-1; j++));do
		if [ ${ary[$j]} -gt ${ary[$j+1]} ];then
	 	 temp=${ary[$j]}
		 ary[$j]=${ary[$j+1]}
		 ary[$j+1]=$temp
		fi
	done
done

echo "${ary[*]}"
